import Vue from 'vue';
import Router from 'vue-router';

import AuthMiddleware from './middleware/auth';

Vue.use(Router);

const routes = [
	{
		path: '/login',
		name: 'login',
		component: () => import('../pages/login.vue'),
	},
	{
		path: '/',
		name: 'index',
		// meta: {
		// 	requireAuth: true,
		// },
		component: () => import('../pages/index.vue'),
	},
];

// Router list
const $router = new Router({
	// mode: 'history',
	routes,
});

// Middleware before handle
$router.beforeEach(AuthMiddleware);

export default $router;
